import request from '@/utils/request'
import type { Action } from '@/types/action'

// 获取社区活动列表
export function getActionList(params: { communityId: number }) {
  return request<Action[]>({
    url: '/community/getActionByCommunityId',
    method: 'get',
    params
  })
}

// 添加社区活动
export function addAction(data: Action) {
  return request<boolean>({
    url: '/community/addAction',
    method: 'post',
    data
  })
}

// 更新社区活动
export function updateAction(data: Action) {
  return request<boolean>({
    url: '/community/updateAction',
    method: 'post',
    data
  })
}

// 删除社区活动
export function deleteAction(data: Action) {
  return request<boolean>({
    url: '/community/delAction',
    method: 'delete',
    data
  })
} 